// fw.scss - 白色背景版本
// 变量定义
$primary-color: #6190e8;
$success-color: #52c41a;
$warning-color: #faad14;
$error-color: #f5222d;
$text-color: #333;
$text-color-secondary: #666;
$text-color-light: #999;
$border-color: #e8e8e8;
$bg-color: #f5f7fa;
$font-size-base: 28rpx;
$border-radius-base: 12rpx;
$box-shadow-base: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);

// 页面容器
.fw-page {
  background-color: #ffffff; // 强制白色背景
  min-height: 100vh;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: $text-color;
}

// 顶部导航
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx 30rpx;
  background-color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  
  .title {
    font-size: 36rpx;
    font-weight: bold;
    color: $primary-color;
  }
  
  .icons {
    display: flex;
    
    .icon {
      margin-left: 30rpx;
      font-size: 36rpx;
      cursor: pointer;
      transition: all 0.3s;
      
      &:active {
        opacity: 0.7;
        transform: scale(0.95);
      }
    }
  }
}

// 轮播图区域
.banner-container {
  margin: 20rpx 30rpx;
  border-radius: $border-radius-base;
  overflow: hidden;
  box-shadow: $box-shadow-base;
  
  .banner-swiper {
    height: 360rpx;
    
    .banner-item {
      height: 100%;
      background-size: cover;
      background-position: center;
      position: relative;
      display: flex;
      align-items: flex-end;
      
      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7));
      }
    }
    
    .banner-content {
      position: relative;
      z-index: 2;
      padding: 30rpx;
      color: #fff;
      
      .banner-title {
        font-size: 40rpx;
        font-weight: bold;
        margin-bottom: 10rpx;
        display: block;
      }
      
      .banner-subtitle {
        font-size: 28rpx;
        margin-bottom: 16rpx;
        display: block;
        opacity: 0.9;
      }
      
      .banner-tag {
        display: inline-block;
        padding: 8rpx 16rpx;
        background-color: $primary-color;
        border-radius: 20rpx;
        font-size: 22rpx;
      }
    }
  }
}

// 通用区域标题
.section-title {
  font-size: 32rpx;
  font-weight: bold;
  margin: 30rpx 30rpx 20rpx;
  padding-left: 16rpx;
  border-left: 8rpx solid $primary-color;
  display: block;
}

// 服务分类区域
.categories-section {
  margin: 0 30rpx;
  
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20rpx;
    
    .category-item {
      background-color: #fff;
      border-radius: $border-radius-base;
      padding: 30rpx 20rpx;
      text-align: center;
      box-shadow: $box-shadow-base;
      transition: all 0.3s;
      
      &:active {
        transform: scale(0.97);
        box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
      }
      
      .category-icon {
        width: 80rpx;
        height: 80rpx;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 40rpx;
        margin: 0 auto 16rpx;
      }
      
      .category-name {
        font-size: 26rpx;
        font-weight: 500;
      }
    }
  }
}

// 热门服务区域
.hot-services-section {
  margin: 0 30rpx;
  
  .services-list {
    .service-item {
      display: flex;
      background-color: #fff;
      border-radius: $border-radius-base;
      margin-bottom: 20rpx;
      overflow: hidden;
      box-shadow: $box-shadow-base;
      transition: all 0.3s;
      
      &:active {
        transform: translateY(4rpx);
        box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
      }
      
      .service-image {
        width: 200rpx;
        height: 160rpx;
        flex-shrink: 0;
      }
      
      .service-info {
        flex: 1;
        padding: 24rpx;
        
        .service-name {
          font-size: 30rpx;
          font-weight: 500;
          margin-bottom: 12rpx;
          display: block;
        }
        
        .service-meta {
          display: flex;
          align-items: center;
          margin-bottom: 12rpx;
          
          .service-price {
            font-size: 32rpx;
            font-weight: bold;
            color: $error-color;
            margin-right: 20rpx;
          }
          
          .service-rating {
            font-size: 26rpx;
            color: $warning-color;
          }
        }
        
        .service-orders {
          font-size: 24rpx;
          color: $text-color-light;
        }
      }
    }
  }
}

// 服务资讯区域
.news-section {
  margin: 0 30rpx;
  
  .news-list {
    .news-item {
      background-color: #fff;
      border-radius: $border-radius-base;
      padding: 24rpx;
      margin-bottom: 20rpx;
      box-shadow: $box-shadow-base;
      
      .news-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16rpx;
        
        .news-title {
          font-size: 30rpx;
          font-weight: 500;
          flex: 1;
          margin-right: 20rpx;
        }
        
        .news-time {
          font-size: 24rpx;
          color: $text-color-light;
          flex-shrink: 0;
        }
      }
      
      .news-content {
        font-size: 26rpx;
        color: $text-color-secondary;
        margin-bottom: 16rpx;
        line-height: 1.5;
        display: block;
      }
      
      .news-views {
        font-size: 24rpx;
        color: $text-color-light;
      }
    }
  }
}

// 快速联系区域
.contact-section {
  display: flex;
  margin: 40rpx 30rpx;
  background-color: #fff;
  border-radius: $border-radius-base;
  overflow: hidden;
  box-shadow: $box-shadow-base;
  
  .contact-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30rpx 20rpx;
    transition: all 0.3s;
    
    &:active {
      background-color: #f9f9f9;
    }
    
    &:first-child {
      border-right: 1rpx solid $border-color;
    }
    
    .contact-icon {
      font-size: 50rpx;
      margin-bottom: 16rpx;
    }
    
    .contact-text {
      font-size: 26rpx;
      font-weight: 500;
    }
  }
}

// 响应式设计
@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  .services-list .service-item .service-image {
    width: 240rpx !important;
    height: 180rpx !important;
  }
}